{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "b98f29e3",
   "metadata": {},
   "source": [
    "* 记录人：LZ\n",
    "* 时间：2022-5-17\n",
    "* week12: 语音系统API\n",
    "* 学习资源： [图灵API接口](https://www.kancloud.cn/turing/www-tuling123-com/718227)   \n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7408cebb",
   "metadata": {},
   "source": [
    "## 1、优化ASR（自动语音识别）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "7003e5f3",
   "metadata": {},
   "outputs": [],
   "source": [
    "API_KEY = '7vVrQGv694z3sSwpGGAPdQSk'\n",
    "SECRET_KEY = '2061LwY18Wq1pIObgqBE8qRwT9NtxUmT'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "3618104c",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-39-7b68e4950b6e>, line 63)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<ipython-input-39-7b68e4950b6e>\"\u001b[1;36m, line \u001b[1;32m63\u001b[0m\n\u001b[1;33m    def asr(token,AUDIO_FILE,CUID=\"123456PYTHON\",DEV_PID=\"1537\")\u001b[0m\n\u001b[1;37m                                                                ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "#封装函数\n",
    "\n",
    "# coding=utf-8\n",
    "\n",
    "import sys\n",
    "import json\n",
    "import time\n",
    "\n",
    "IS_PY3 = sys.version_info.major == 3\n",
    "\n",
    "if IS_PY3:\n",
    "    from urllib.request import urlopen\n",
    "    from urllib.request import Request\n",
    "    from urllib.error import URLError\n",
    "    from urllib.parse import urlencode\n",
    "\n",
    "    timer = time.perf_counter   # 语音识别过程时间\n",
    "else:\n",
    "    import urllib2\n",
    "    from urllib2 import urlopen\n",
    "    from urllib2 import Request\n",
    "    from urllib2 import URLError\n",
    "    from urllib import urlencode\n",
    "\n",
    "    if sys.platform == \"win32\":\n",
    "        timer = time.clock\n",
    "    else:\n",
    "        timer = time.time\n",
    "SCOPE = 'audio_voice_assistant_get'  # 有此scope表示有asr能力，没有请在网页里勾选，非常旧的应用可能没有\n",
    "\n",
    "\n",
    "\n",
    "class DemoError(Exception):\n",
    "    pass\n",
    "def fetch_token(API_KEY,SECRET_KEY):\n",
    "    params = {'grant_type': 'client_credentials',\n",
    "              'client_id': API_KEY,\n",
    "              'client_secret': SECRET_KEY}\n",
    "    post_data = urlencode(params)\n",
    "    if (IS_PY3):\n",
    "        post_data = post_data.encode('utf-8')\n",
    "    req = Request('http://aip.baidubce.com/oauth/2.0/token', post_data)\n",
    "    try:\n",
    "        f = urlopen(req)\n",
    "        result_str = f.read()\n",
    "    except URLError as err:\n",
    "        print('token http response http code : ' + str(err.code))\n",
    "        result_str = err.read()\n",
    "    if (IS_PY3):\n",
    "        result_str = result_str.decode()\n",
    "#    print(result_str)\n",
    "    result = json.loads(result_str)\n",
    "#    print(result)\n",
    "    if ('access_token' in result.keys() and 'scope' in result.keys()):\n",
    "        if SCOPE and (not SCOPE in result['scope'].split(' ')):  # SCOPE = False 忽略检查\n",
    "            raise DemoError('scope is not correct')\n",
    "        print('SUCCESS WITH TOKEN: %s ; EXPIRES IN SECONDS: %s' % (result['access_token'], result['expires_in']))\n",
    "        return result['access_token']\n",
    "    else:\n",
    "        raise DemoError('MAYBE API_KEY or SECRET_KEY not correct: access_token or scope not found in token response')\n",
    "\n",
    "\n",
    "def asr(token,AUDIO_FILE,CUID=\"123456PYTHON\",DEV_PID=\"1537\")\n",
    "    speech_data = []\n",
    "    with open(AUDIO_FILE, 'rb') as speech_file:\n",
    "        speech_data = speech_file.read()\n",
    "    length = len(speech_data)\n",
    "    if length == 0:\n",
    "        raise DemoError('file %s length read 0 bytes' % AUDIO_FILE)\n",
    "\n",
    "    params = {'cuid': CUID, 'token': token, 'dev_pid': DEV_PID}\n",
    "\n",
    "    params_query = urlencode(params);\n",
    "\n",
    "    headers = {\n",
    "        'Content-Type': 'audio/' + AUDIO_FILE[-3:] + '; rate=' + str(RATE),\n",
    "        'Content-Length': length\n",
    "    }\n",
    "\n",
    "    url = 'http://vop.baidu.com/server_api'\n",
    "    req = Request(ASR_URL + \"?\" + params_query, speech_data, headers)\n",
    "    try:\n",
    "        begin = timer()\n",
    "        f = urlopen(req)\n",
    "        result_str = f.read()\n",
    "        print(\"Request time cost %f\" % (timer() - begin))\n",
    "    except  URLError as err:\n",
    "        print('asr http response http code : ' + str(err.code))\n",
    "        result_str = err.read()\n",
    "\n",
    "    if (IS_PY3):\n",
    "        result_str = str(result_str, 'utf-8')\n",
    "    print(result_str)\n",
    "    with open(\"result.txt\", \"w\") as of:\n",
    "        of.write(result_str)\n",
    "    return result_str"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "6eef2100",
   "metadata": {},
   "outputs": [],
   "source": [
    "from bdasr import fetch_token,asr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "9454a4b7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'24.1653073bf8eedb80c86b1d9153959a91.2592000.1656085787.282335-26194923'"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "token = fetch_token(API_KEY,SECRET_KEY)\n",
    "token"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "9dfac148",
   "metadata": {},
   "outputs": [],
   "source": [
    "import speech_recognition\n",
    "\n",
    "r = speech_recognition.Recognizer()\n",
    "\n",
    "with speech_recognition.Microphone() as source:\n",
    "    audio = r.listen(source)\n",
    "# 将数据保存到wav文件中\n",
    "with open(\"2.wav\", \"wb\") as f: \n",
    "    f.write(audio.get_wav_data(convert_rate=16000))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "4cb7ceb3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Request time cost 0.179652\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'{\"corpus_no\":\"7101701757796313778\",\"err_msg\":\"success.\",\"err_no\":0,\"result\":[\"你好。\"],\"sn\":\"51725132741653493791\"}\\n'"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "asr(token,'2.wav')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "03f0338f",
   "metadata": {},
   "source": [
    "## 2.连接图灵机器人  \n",
    "* 接口地址：http://openapi.turingapi.com/openapi/api/v2  \n",
    "* 请求方式：POST  \n",
    "* 请求参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "0aeec8f1",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests,json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "3e577f2e",
   "metadata": {},
   "outputs": [],
   "source": [
    "TL_KEY = \"d5d5bb66f66d4da8bedb378df7adfa70\"\n",
    "TL_URL = \"http://openapi.turingapi.com/openapi/api/v2\"\n",
    "\n",
    "payload={\n",
    "    \"reqType\":0,\n",
    "    \"perception\": {\n",
    "        \"inputText\": {\n",
    "            \"text\": \"苹果用英语怎么说\"\n",
    "        },\n",
    "    },\n",
    "    \"userInfo\": {\n",
    "        \"apiKey\": TL_KEY,\n",
    "        \"userId\": \"01\"\n",
    "    }\n",
    "}\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "0265e49d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "c5ac2304",
   "metadata": {},
   "outputs": [],
   "source": [
    "res = requests.post(TL_URL,data = json.dumps(payload))  # 字典 不等于json 所以两者格式不同 需要用函数来转换 dict--> json :json.dumps()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "0c260391",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'intent': {'actionName': '', 'code': 10020, 'intentName': ''},\n",
       " 'results': [{'groupType': 1,\n",
       "   'resultType': 'text',\n",
       "   'values': {'text': 'apple'}}]}"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res.json()   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "355a8595",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'apple'"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res.json()['results'][0]['values']['text']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "df667806",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 封装函数\n",
    "def TL_API(key,text):\n",
    "        TL_KEY = \"d5d5bb66f66d4da8bedb378df7adfa70\"  \n",
    "        TL_URL = \"http://openapi.turingapi.com/openapi/api/v2\"  \n",
    "        payload = {\n",
    "            \"reqType\":0,\n",
    "            \"perception\": {\n",
    "                \"inputText\": {\n",
    "                    \"text\": text\n",
    "                },\n",
    "            },\n",
    "            \"userInfo\": {\n",
    "                \"apiKey\": \"d5d5bb66f66d4da8bedb378df7adfa70\",\n",
    "                \"userId\": \"01\"\n",
    "            }\n",
    "        }\n",
    "        res = requests.post(TL_URL,data= json.dumps(payload))\n",
    "        return res.json()['results'][0]['values']['text']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f4eeec11",
   "metadata": {},
   "source": [
    "## 3.接入对话语音机器人流程  \n",
    "1. 录制音频  \n",
    "2. 语音识别--（百度ASR接口）-- 音频转文本信息  \n",
    "3. 图灵API--（进行文字输入和文字回复）\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "eaa8a9f5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Request time cost 0.237289\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'无题一边草地，打一种花~？'"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 1.录制音频  \n",
    "import speech_recognition\n",
    "\n",
    "r = speech_recognition.Recognizer()\n",
    "\n",
    "with speech_recognition.Microphone() as source:\n",
    "    audio = r.listen(source)\n",
    "# 将数据保存到wav文件中\n",
    "with open(\"4.wav\", \"wb\") as f: \n",
    "    f.write(audio.get_wav_data(convert_rate=16000))\n",
    "    \n",
    "# 2.语音识别  \n",
    "token = fetch_token(API_KEY,SECRET_KEY)  \n",
    "asr_output = eval(asr(token,'4.wav'))['result'][0]\n",
    "\n",
    "# 3.图灵API  \n",
    "TL_API(TL_KEY,asr_output)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bf775d9b",
   "metadata": {},
   "source": [
    "## 4.语音合成"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "b4665fae",
   "metadata": {},
   "outputs": [],
   "source": [
    "API_KEY = \"4E1BG9lTnlSeIf1NQFlrSq6h\"\n",
    "SECRET_KEY = \"544ca4657ba8002e3dea3ac2f5fdd241\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "e34aa6a4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# coding=utf-8\n",
    "import sys\n",
    "import json\n",
    "\n",
    "IS_PY3 = sys.version_info.major == 3\n",
    "if IS_PY3:\n",
    "    from urllib.request import urlopen\n",
    "    from urllib.request import Request\n",
    "    from urllib.error import URLError\n",
    "    from urllib.parse import urlencode\n",
    "    from urllib.parse import quote_plus\n",
    "else:\n",
    "    import urllib2\n",
    "    from urllib import quote_plus\n",
    "    from urllib2 import urlopen\n",
    "    from urllib2 import Request\n",
    "    from urllib2 import URLError\n",
    "    from urllib import urlencode\n",
    "\n",
    "\n",
    "\n",
    "TEXT = \"欢迎使用百度语音合成。\"\n",
    "\n",
    "# 发音人选择, 基础音库：0为度小美，1为度小宇，3为度逍遥，4为度丫丫，\n",
    "# 精品音库：5为度小娇，103为度米朵，106为度博文，110为度小童，111为度小萌，默认为度小美 \n",
    "PER = 4\n",
    "# 语速，取值0-15，默认为5中语速\n",
    "SPD = 5\n",
    "# 音调，取值0-15，默认为5中语调\n",
    "PIT = 5\n",
    "# 音量，取值0-9，默认为5中音量\n",
    "VOL = 5\n",
    "# 下载的文件格式, 3：mp3(default) 4： pcm-16k 5： pcm-8k 6. wav\n",
    "AUE = 6\n",
    "\n",
    "FORMATS = {3: \"mp3\", 4: \"pcm\", 5: \"pcm\", 6: \"wav\"}\n",
    "FORMAT = FORMATS[AUE]\n",
    "\n",
    "CUID = \"123456PYTHON\"\n",
    "\n",
    "TTS_URL = 'http://tsn.baidu.com/text2audio'\n",
    "\n",
    "\n",
    "class DemoError(Exception):\n",
    "    pass\n",
    "\n",
    "\n",
    "\"\"\"  TOKEN start \"\"\"\n",
    "\n",
    "TOKEN_URL = 'http://aip.baidubce.com/oauth/2.0/token'\n",
    "SCOPE = 'audio_tts_post'  # 有此scope表示有tts能力，没有请在网页里勾选\n",
    "\n",
    "'''\n",
    "def fetch_token():\n",
    "    print(\"fetch token begin\")\n",
    "    params = {'grant_type': 'client_credentials',\n",
    "              'client_id': API_KEY,\n",
    "              'client_secret': SECRET_KEY}\n",
    "    post_data = urlencode(params)\n",
    "    if (IS_PY3):\n",
    "        post_data = post_data.encode('utf-8')\n",
    "    req = Request(TOKEN_URL, post_data)\n",
    "    try:\n",
    "        f = urlopen(req, timeout=5)\n",
    "        result_str = f.read()\n",
    "    except URLError as err:\n",
    "        print('token http response http code : ' + str(err.code))\n",
    "        result_str = err.read()\n",
    "    if (IS_PY3):\n",
    "        result_str = result_str.decode()\n",
    "\n",
    "#    print(result_str)\n",
    "    result = json.loads(result_str)\n",
    "    print(result)\n",
    "    if ('access_token' in result.keys() and 'scope' in result.keys()):\n",
    "        if not SCOPE in result['scope'].split(' '):\n",
    "            raise DemoError('scope is not correct')\n",
    "#        print('SUCCESS WITH TOKEN: %s ; EXPIRES IN SECONDS: %s' % (result['access_token'], result['expires_in']))\n",
    "        return result['access_token']\n",
    "    else:\n",
    "        raise DemoError('MAYBE API_KEY or SECRET_KEY not correct: access_token or scope not found in token response')\n",
    "'''\n",
    "\n",
    "\"\"\"  TOKEN end \"\"\"\n",
    "\n",
    "def tts(token,TEXT):\n",
    "\n",
    "    tex = quote_plus(TEXT)  # 此处TEXT需要两次urlencode\n",
    "    print(tex)\n",
    "    params = {'tok': token, 'tex': tex, 'per': PER, 'spd': SPD, 'pit': PIT, 'vol': VOL, 'aue': AUE, 'cuid': CUID,\n",
    "              'lan': 'zh', 'ctp': 1}  # lan ctp 固定参数\n",
    "\n",
    "    data = urlencode(params)\n",
    "    print('test on Web Browser' + TTS_URL + '?' + data)\n",
    "\n",
    "    req = Request(TTS_URL, data.encode('utf-8'))\n",
    "    has_error = False\n",
    "    try:\n",
    "        f = urlopen(req)\n",
    "        result_str = f.read()\n",
    "\n",
    "        headers = dict((name.lower(), value) for name, value in f.headers.items())\n",
    "\n",
    "        has_error = ('content-type' not in headers.keys() or headers['content-type'].find('audio/') < 0)\n",
    "    except  URLError as err:\n",
    "        print('asr http response http code : ' + str(err.code))\n",
    "        result_str = err.read()\n",
    "        has_error = True\n",
    "\n",
    "    save_file = \"error.txt\" if has_error else 'result.' + FORMAT\n",
    "    with open(save_file, 'wb') as of:\n",
    "        of.write(result_str)\n",
    "\n",
    "    if has_error:\n",
    "        if (IS_PY3):\n",
    "            result_str = str(result_str, 'utf-8')\n",
    "        print(\"tts api  error:\" + result_str)\n",
    "\n",
    "    print(\"result saved as :\" + save_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "4b1fb2df",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "%E6%AC%A2%E8%BF%8E%E4%BD%BF%E7%94%A8%E7%99%BE%E5%BA%A6%E8%AF%AD%E9%9F%B3%E5%90%88%E6%88%90%E3%80%82\n",
      "test on Web Browserhttp://tsn.baidu.com/text2audio?tok=24.f2d8182d3cb556c3d5a1a9f556404f80.2592000.1656085709.282335-10854623&tex=%25E6%25AC%25A2%25E8%25BF%258E%25E4%25BD%25BF%25E7%2594%25A8%25E7%2599%25BE%25E5%25BA%25A6%25E8%25AF%25AD%25E9%259F%25B3%25E5%2590%2588%25E6%2588%2590%25E3%2580%2582&per=4&spd=5&pit=5&vol=5&aue=6&cuid=123456PYTHON&lan=zh&ctp=1\n",
      "tts api  error:{\"err_detail\":\"16: Open api characters limit reached\",\"err_msg\":\"16: Open api characters limit reached\",\"err_no\":502,\"err_subcode\":16,\"tts_logid\":1894516598}\n",
      "\n",
      "result saved as :error.txt\n"
     ]
    }
   ],
   "source": [
    "tts(token,TEXT)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f85aac6b",
   "metadata": {},
   "source": [
    "### 在jupyter 中播放音频文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "6bb63755",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\pydub\\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work\n",
      "  warn(\"Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work\", RuntimeWarning)\n"
     ]
    }
   ],
   "source": [
    "from pydub import AudioSegment  \n",
    "from pydub.playback import play  \n",
    "song = AudioSegment.from_wav('result.wav')\n",
    "play(song)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "0cef029a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting pydub\n",
      "  Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
      "Installing collected packages: pydub\n",
      "Successfully installed pydub-0.25.1\n"
     ]
    }
   ],
   "source": [
    "!pip install pydub"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1d693a89",
   "metadata": {},
   "source": [
    "## 5.智能对话机器人最终版"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "5baf0bd2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Request time cost 0.249114\n",
      "%E5%A5%BD%E5%90%A7%EF%BC%8C%E4%BD%A0%E4%B9%9F%E5%A5%BD%E3%80%82\n",
      "test on Web Browserhttp://tsn.baidu.com/text2audio?tok=24.3f5a9d04a7b1875650bdde3699df8dac.2592000.1656085869.282335-26194923&tex=%25E5%25A5%25BD%25E5%2590%25A7%25EF%25BC%258C%25E4%25BD%25A0%25E4%25B9%259F%25E5%25A5%25BD%25E3%2580%2582&per=4&spd=5&pit=5&vol=5&aue=6&cuid=123456PYTHON&lan=zh&ctp=1\n",
      "result saved as :result.wav\n"
     ]
    }
   ],
   "source": [
    "import speech_recognition  #语音音频录制模块\n",
    "from pydub import AudioSegment  # 播放音频模块\n",
    "from pydub.playback import play  # 语音播放模块\n",
    "from bdasr import fetch_token,asr  # 语音识别模块\n",
    "from bdtts import tts # 语音合成模块 \n",
    "\n",
    "# 1.录制音频 \n",
    "r = speech_recognition.Recognizer()\n",
    "with speech_recognition.Microphone() as source:\n",
    "    audio = r.listen(source)\n",
    "with open(\"3.wav\", \"wb\") as f: \n",
    "    f.write(audio.get_wav_data(convert_rate=16000))\n",
    "    \n",
    "# 2.语音识别  \n",
    "token = fetch_token(API_KEY,SECRET_KEY)  \n",
    "asr_output = eval(asr(token,'3.wav'))['result'][0]\n",
    "\n",
    "# 3.图灵API  \n",
    "TL_result = TL_API(TL_KEY,asr_output) \n",
    "\n",
    "# 4.语音合成TTS--> 产生 result.wav\n",
    "tts(token,TL_result)\n",
    "\n",
    "# 5.在jupyter 中进行语音播放\n",
    "song = AudioSegment.from_wav('result.wav')\n",
    "play(song)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "52213f1d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
